<!DOCTYPE html>
<html lang="en">
<head>
    {include file="common/meta" /}

    <!-- Title -->
    <title>{:config('system.web_name')}</title>
</head>

<body class="page-header-fixed page-sidebar-fixed">

<div id="preloader"><i>.</i><i>.</i><i>.</i></div>

<!-- Page Container -->
<div class="page-container">
    <!-- Page Sidebar -->
    <div class="page-sidebar">
        <div class="profile-menu">
            <a href="javascript: void(0);">
                <i class="ri-dashboard-fill"></i>
            </a>
        </div>
        <div class="page-sidebar-inner">
            <div class="page-sidebar-menu">
                <ul>
                    {foreach $menu as $index => $m}
                    <li class="target-secondary-sidebar" data-target="accordion-menu-{$index}" data-toggle="tooltip" data-placement="right" title="{$m.name}">
                        <a href="javascript: void(0);">
                            {if $m['img']}
                            <img src="{$m.img}" class="img">
                            {elseif($m['icon'])}
                            <i class="{$m.icon} icon"></i>
                            {/if}
                        </a>
                    </li>
                    {/foreach}
                </ul>
            </div>
        </div>
        <div class="settings-menu-btn">
            <a href="javascript:void(0)" style="margin-bottom: 8px" data-toggle="tooltip" data-placement="right" title="{:session('admin.username')}"><img src="{:session('admin.avatar')}" alt="" class="rounded-circle"></a>
            <a href="javascript:void(0)" id="toggle-fullscreen" data-toggle="tooltip" data-placement="right" title="全屏"><i class="ri-fullscreen-fill"></i></a>
            <a href="javascript:void(0)" class="settings-menu-link" data-toggle="tooltip" data-placement="right" title="工具"><i class="ri-list-settings-line"></i></a>
            <a href="/backend/index/logout" data-toggle="tooltip" data-placement="right" title="退出"><i class="ri-logout-circle-line"></i></a>
        </div>
    </div><!-- /Page Sidebar -->
    <div class="settings-sidebar">
        <div class="settings-sidebar-content">
            <div class="settings-sidebar-header">
                <span>设置</span>
                <a href="javascript: void(0);" class="settings-menu-close">
                    <i class="ri-close-line"></i>
                </a>
            </div>
            <div class="sidebar-settings">
                <span class="settings-title"><i class="ri-bubble-chart-fill"></i> 主题设置</span>
                <div class="row square-box">
                    <div class="col-sm grid theme-box">
                        <div class="theme-list" data-name="black"></div>
                        <div class="theme-list" data-name="purple"></div>
                        <div class="theme-list" data-name="green"></div>
                        <div class="theme-list" data-name="blue"></div>
                    </div>
                </div>
                <span class="settings-title"><i class="ri-settings-fill"></i>清理缓存</span>
                <div class="row square-box">
                    <div class="col-sm grid">
                        <a href="/backend/index/clean">
                            <i class="ri-delete-bin-3-line"></i>
                            <div class="title">缓存清理</div>
                        </a>
                    </div>
                </div>
            </div>
            <div class="setter-footer">
                <p>{:date('Y')} &copy; <a href="https://zsw.ink" target="_blank">zsw</a></p>
            </div>
        </div>
    </div>
    <div class="settings-overlay"></div>
    <!-- Page Content -->
    <div class="page-content">
        <div class="secondary-sidebar">
            <div class="secondary-sidebar-bar">
                <a href="javascript: void(0);" class="logo-box"><span>菜单</span></a>
            </div>
            <div class="secondary-sidebar-menu">
                {foreach $menu as $k1 => $m1}
                <ul class="accordion-menu" id="accordion-menu-{$k1}">
                    {if isset($m1['children'])}
                    {foreach $m1['children'] as $k2 => $m2}
                    <li class="open">
                        {if !empty($m2['children'])}
                        <a href="javascript:void(0)">
                            {if $m2['icon']}<i class="menu-icon {$m2.icon}"></i>{/if} <span>{$m2.name}</span>
                            <i class="accordion-icon ri-arrow-right-s-line"></i>
                        </a>
                        <ul class="sub-menu">
                            {foreach $m2.children as $m3}
                            <li>
                                <a href="{$m3.route}" class="z_frame">
                                    {if $m3['icon']}<i class="menu-icon {$m3.icon}"></i>{/if} <span>{$m3.name}</span>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                        {else}
                        <a href="{$m2.route}" class="z_frame">
                            {if $m2['icon']}<i class="menu-icon  {$m2.icon}"></i>{/if} <span>{$m2.name}</span>
                        </a>
                        {/if}
                    </li>
                    {/foreach}

                    {/if}
                </ul>
                {/foreach}
            </div>
        </div>
        <!-- Page Header -->
        <div class="page-header">
            <nav class="navbar navbar-default navbar-expand-md">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <div class="logo-sm">
                            <a href="javascript:void(0)" id="sidebar-toggle-button"><i class="ri-menu-line"></i></a>
                            <a class="logo-box" href="javascript: void(0);"><span>菜单</span></a>
                        </div>
                        <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <i class="ri-more-fill"></i>
                        </button>
                    </div>

                    <div class="collapse navbar-collapse justify-content-between" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav mr-auto page-tabs"></ul>
                    </div>

                </div><!-- /.container-fluid -->
            </nav>
        </div><!-- /Page Header -->

        <!-- Page Inner -->
        <div class="page-inner no-page-title" id="content-main"></div>

    </div><!-- /Page Content -->
    <div class="shield"></div>
</div><!-- /Page Container -->

{include file="common/script" /}

<script>
    //  动画
    ;jQuery(window).on("load", function () {
        $("#preloader").fadeOut(100);
    })
</script>

<script src="/static/backend/js/admin.js"></script>

</body>
</html>
